package collections;
import java.util.*;

class GrannySmith extends Apple{}

class Gala extends Apple{}
class Fuji extends Apple{}
class Braeburn extends Apple{}
public class GenericsAndUpcasting {

	public GenericsAndUpcasting() {
		// TODO 自动生成的构造函数存根
	}

	public static void main(String[] args) {
		// TODO 自动生成的方法存根
		ArrayList<Apple> apples = new ArrayList<>();
		List<Apple> apples1 = new ArrayList<>();
		
		apples.add(new GrannySmith());
		apples.add(new Gala());
		apples.add(new Fuji());

		apples.add(new Braeburn());
		for(Apple apple:apples) {
			System.out.println(apple);
		}

	}

}
